package com.xn2001.feign.clients;

import com.xn2001.feign.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 声明远程调用的接口：需在启动类开启@EnableFeignClients
 * @FeignClient("userservice"),需和nacos中的服务名称保持一致
 */
@FeignClient("userservice")
public interface UserServiceClient {

    @GetMapping("/user/{id}")
    User findUserById(@PathVariable("id") Long id);
}
